var gc = new GameCities();
gc.addCity( "London, United Kingdom", "london.html", "Lady Deedi is in city that has the largest famous clock in the world." );
gc.addCity( "New Delhi, India", "newdelhi.html", "Lady Deedi is in city that has a famous building has been built by a famous king for his wife." );
gc.addCity( "Sydney, Australia", "sydney.html", "Lady Deedi is in city that has big Opera House by the ocean." );
gc.addCity( "Cairo, Egypt", "cairo.html", "Lady Deedi is in city that has Historical Pyramids." );
gc.addCity( "Jeddah, Saudi Arabia", "jeddah.html", "Lady Deedi is in city that has the highest fountain in the middle east.");
gc.addCity( "Dubai, United Arab Emirates", "dubai1.html", "Clue for DUB" );
gc.addCity( "Auckland, New Zealand", "auckland1.html", "Clue for AZE" );
gc.addCity( "Beijing, China", "beijing1.html", "Clue for BJI" );
gc.addCity( "Istanbul, Turkey", "istanbul1.html", "Clue for IST" );
gc.addCity( "Kualalumpur, Malaysia", "kualalumpur1.html", "Clue for KUM" );
gc.addCity( "New Mexico, Mexico", "newmexico1.html", "Clue for NEW" );
gc.addCity( "New York, USA", "newyork1.html", "Clue for NEY" );
gc.addCity( "Paris, France", "paris1.html", "Clue for PRS" );
gc.addCity( "Toronto, Canada", "toronto1.html", "Clue for TRN" );


//gc.randomizeCities();
gc.setPathCities();

// This function is called whenever a destination page is loaded. 
// Since the clues and the possible destinations are based on a calculation,
// they must be dynamically loaded
function loadPage( name ) 
{
	// Retrieve and display the clue
	document.getElementById( "main-frame" ).contentWindow.document.getElementById( "clue" ).innerHTML = gc.getClue( name );
	
	var destinations = gc.getDestinations( name );
	
	var output = "<a href='sanantonio.html'>San Antonio, USA</a><br/>";
	
	for( i = 0; i < destinations.length; i = i + 1 )
	{
		output = output + "<a href='" + destinations[ i ].file + "'>" + destinations[ i ].city + "</a><br/>";
	}
	document.getElementById( "main-frame" ).contentWindow.document.getElementById( "destinations" ).innerHTML = output;
	
	//alert( output );
}

function showDestinations()
{
	document.getElementById( "main-frame" ).contentWindow.document.getElementById( "destinations" ).style.display = "inline";
	
}


function showClue()
{
	document.getElementById( "main-frame" ).contentWindow.document.getElementById( "clue" ).style.display = "inline";
	
}